|
|
4.3 | Switch Operation | ||
| 4.3.3 | How switches and bridges learn addresses |
|
Bridges and switches only forward
frames, which need to travel from one LAN segment to another. To accomplish
this task, they must learn which devices are connected to which LAN
segment.
A bridge is considered an intelligent device because it can make decisions based on MAC addresses. To do this, a bridge refers to an address table. When a bridge is turned on, broadcast messages are transmitted asking all the stations on the local segment of the network to respond. As the stations return the broadcast message, the bridge builds a table of local addresses. This process is called learning. Bridges and switches learn in the following ways:
In this way, the bridge or switch learns which addresses belong to the devices connected to each port. The learned addresses and associated port or interface are stored in the addressing table. The bridge examines the destination address of all received frames. The bridge then scans the address table searching for the destination address. CAM is used in switch applications:
The CAM stores host MAC addresses and
associated port numbers. The CAM compares the received destination MAC
address against
the CAM table contents. If the comparison yields a
match, the port is provided, and routing control forwards the packet
to the correct port and address.
An Ethernet switch can learn the address of each device on the network by reading the source address of each frame transmitted and noting the port where the frame entered the switch. The switch then adds this information to its forwarding database. Addresses are learned dynamically. This means that as new addresses are read, they are learned and stored in CAM. When a source address is not found in CAM, it is learned and stored for future use. Each time an address is stored, it is time stamped. This allows for addresses to be stored for a set period of time. Each time an address is referenced or found in CAM, it receives a new time stamp. Addresses that are not referenced during a set period of time are removed from the list. By removing aged or old addresses, CAM maintains an accurate and functional forwarding database. The processes followed by the CAM are
as follows: The address may also have been deleted
by the bridge because the bridge software was recently
restarted, ran short of address entries in the address table, or
deleted the address because it was too old. Since the bridge
does not know which port to use to forward the frame, it will
send it to out all ports, except the one from which it was
received. It is clearly unnecessary to send it back to the same
cable segment from which it was received, since any other
computer or bridges on this cable must already have received the
packet.
|